package com.lipaluma.xml.adaptor;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;

import com.lipaluma.field.adaptor.Adaptor;
import com.lipaluma.field.adaptor.impl.TruncateAdaptor;

@XmlRootElement(name=XmlTruncateAdaptor.TRUNCATE)
@XmlAccessorType(XmlAccessType.FIELD)
public class XmlTruncateAdaptor implements XmlAdaptor {
	public static final String TRUNCATE = "truncate";
	
	@XmlAttribute(required=true)
	private int at;
	@XmlAttribute
	private String suffix;
	
	@Override
	public Class<? extends Adaptor> with() {
		return TruncateAdaptor.class;
	}
	
	public int truncateAt() {
		return at;
	}
	public void setAt(int at) {
		this.at = at;
	}
	public String getSuffix() {
		return suffix;
	}
	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}
}
